--[[
编码: JX-51-10
名称:
作者:
日期:2025-1-29
函数: OpenHTMLViewDlg
功能:
显示配盘结果
更改记录:
--]]
jx_base= require( "jx_base" )
-- 生成一个容器料格货品显示样式
local function generate_distribution_html_item( strLuaDEID, cntr_code, cell_no, item_code, item_name, qty, bs_no )
local nRet, img_url
nRet, img_url = wms_base.Get_sConst2( strLuaDEID, "网站URL" )
if ( nRet ~= 0 ) then return 1, "系统无法获取常量'网站URL'" end
local img = img_url..cell_no..".png"
local content =
'
'..
'
'..
'料箱号:'..
''..cntr_code..''..
'
'..
'
'..
'
'..
'

'..
'
'..
'
'..
'
'..
'料格:'..
''..cell_no..''..
'
'..
'
'..
'货品编码:'..
''..item_code..''..
'
'..
'
'..
'货品名称:'..
''..item_name..''..
'
'..
'
'..
'数量:'..
''..qty..''..
'
'..
'
'..
'出库单:'..
''..bs_no..''..
'
'..
'
'..
'
'..
'
'
return 0, content
end
function OpenHTMLViewDlg( strLuaDEID )
local nRet, strRetInfo, data_json
local img_url
nRet, img_url = wms_base.Get_sConst2( strLuaDEID, "网站URL" )
if ( nRet ~= 0 ) then
lua.Stop( strLuaDEID, "系统无法获取常量'网站URL'")
return
end
nRet, data_json = m3.GetSysDataJson( strLuaDEID )
if ( nRet ~=0 ) then lua.Error( strLuaDEID, debug.getinfo(1), data_json ) end
local str_html
if ( data_json.d_cntr_detail_list == nil or #data_json.d_cntr_detail_list == 0 ) then
str_html= '
'
else
str_html = ''
local str_item
for n = 1, #data_json.d_cntr_detail_list do
nRet, str_item = generate_distribution_html_item( strLuaDEID,
data_json.d_cntr_detail_list[n].cntr_code,
data_json.d_cntr_detail_list[n].cell_no,
data_json.d_cntr_detail_list[n].item_code,
data_json.d_cntr_detail_list[n].item_name,
data_json.d_cntr_detail_list[n].qty,
data_json.d_cntr_detail_list[n].bs_no )
if ( nRet ~= 0 ) then
lua.Stop( strLuaDEID, str_item )
return
end
str_html = str_html..str_item
end
str_html = str_html..'
'
end
local action = {
{
action_type = "set_panel_html",
value = str_html
}
}
nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action) )
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction失败! "..strRetInfo..' action = '..strAction ) end
end